<?php
/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of Index
 *
 * @author ananda
 */
class Action_Main_Test extends Action
{
    /**
     * 消息系统初始时的唯一入口
     */
    public function main()
    {
        $url    = Request::get('url', '');
        $act    = Request::get('act', 'main');
        $param1 = Request::get('param1', '');
        $param2 = Request::get('param2', '');
        $param3 = Request::get('param3', '');
        $param4 = Request::get('param4', '');
        $param5 = Request::get('param5', '');
        $param6 = Request::get('param6', '');
        $param7 = Request::get('param7', '');
        $param8 = Request::get('param8', '');

        $result = '';
        if ($url) {
            $rpc = new jsonRPCClient($url);
            try {
                $result = $rpc->$act($param1, $param2, $param3, $param4, $param5, $param6, $param7, $param8);
            } catch (Exception $e) {
                $result = $e->getMessage();
            }
        }
        ?>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<textarea cols="50" rows="8"><?=$result?></textarea>
<form method="post">
    <p>URL:<input type="text" name="url" size="50" value="<?=$url?>" /></p>
    <p>Action:<input type="text" name="act" size="20" value="<?=$act?>" /></p>
    <p>Params:<input type="text" name="param1" value="<?=$param1?>" /><br />
    Params:<input type="text" name="param2" value="<?=$param2?>" /><br />
    Params:<input type="text" name="param3" value="<?=$param3?>" /><br />
    Params:<input type="text" name="param4" value="<?=$param4?>" /><br />
    Params:<input type="text" name="param5" value="<?=$param5?>" /><br />
    Params:<input type="text" name="param6" value="<?=$param6?>" /><br />
    Params:<input type="text" name="param7" value="<?=$param7?>" /><br />
    Params:<input type="text" name="param8" value="<?=$param8?>" /></p>
    <p><input type="submit" /></p>
</form>
<?php
    }

}
